<% %>
<h1><%='Statistic by project'.t%></h1>
<%=form_remote_tag :url=>{:action=>'result_project'},
                   :loading=>"Element.show('indicator-tab')",
                   :complete=>"Element.hide('indicator-tab');Effect.BlindUp('stat_form');Effect.BlindDown('stat_link')"
%>
<div id='stat_link' style="display:none;height:45px">
  <div id=Tabs><a href=# onclick="javascript:Effect.BlindDown('stat_form');Element.hide('stat_link');"><%='Statistic Again'.t%></a></div>
</div>
<div id='stat_form'>
<table class=data>
<tr align=center style="border-bottom:2px solid">
   <td>
   </td>
   <td>
    <%=submit_tag " Start Statistic ".t,:onclick=>"check('s_project');",:id=>"submit_tag",:style=>"margin-bottom:8px;"%>
   </td>
   <td>
    <%=indicator_tab%>
   </td>
</tr>
<tr align=center>
   <td>
     <%='All projects'.t%>
	 <hr size=1>
     <select id="project" size=10 multiple style="width:225;height:100px">
	  <%=options_from_collection_for_select(@projects,:id,:name)%>
	 </select>
   </td>
   <Td>
    <input type="button" value="&gt;&gt;" onclick="Button_OnClick('project','s_project')"><br><br>
	<input type="button" value="&lt;&lt;" name="LeftButton" onclick="Button_OnClick('s_project','project')">
   </td>
   <Td>
     <%='Selected projects'.t%>
	 <hr size=1>
     <select id="s_project" name="s_projects[]" multiple size=10 style="width:225;height:100px">
	  <%=options_from_collection_for_select(@s_projects,:id,:name)%>
	 </select>
   </td>
</tr>
<tr>
   <td align=center><%='From date'.t%></td>
   <td colspan=2>
	<%=select_datetime session[:user].company.created_at,:prefix=>'time_log[start_at]'%>
   </td>
</tr>
<tr>
   <td align=center><%='To date'.t%></td>
   <td colspan=2>
	<%=select_datetime Time.now,:prefix=>'time_log[end_at]'%>
   </td>
</tr>
<tr>
   <td align=center><%='Confirm Type'.t%></td>
   <td colspan=2>
	<%=radio_button 'time_log','confirmed_time','all time'%><%='ALL Time'.t%>
	<%=radio_button 'time_log','confirmed_time','confirmed time',:checked=>true%><%='Confimed Time'.t%>
	<%=radio_button 'time_log','confirmed_time','unconfirmed time'%><%='Unconfimed Time'.t%>
   </td>
</tr>
<tr>
   <td align=center><%='Work Type'.t%></td>
   <td colspan=2>
	<%=radio_button 'time_log','work_time','all time',:checked=>true%><%='ALL Time'.t%>
	<%=radio_button 'time_log','work_time','work time'%><%='Work Time'.t%>
	<%=radio_button 'time_log','work_time','after work time'%><%='After Work Time'.t%>
   </td>
</tr>
</table>
<%=end_form_tag%>
</div>
<div id = "result">
  
</div>
